package business;

import dao.*;
import database.*;

public class DaoFactory {
	public static UserDao getUserDao() throws Exception{
		if(userDao == null){
			userDao = new UserDaoImpl();
		}
		return userDao;
	}
	public static ProductDao getProductDao() throws Exception {
		if(productDao == null) {
			productDao = new ProductDaoImpl();
		}
		return productDao;
	}
	public static CategoryDao getCategoryDao() throws Exception {
		if(categoryDao == null) {
			categoryDao = new CategoryDaoImpl();
		}
		return categoryDao;
	}
	public static OrderDao getOrderDao() throws Exception {
		if(orderDao == null) {
			orderDao = new OrderDaoImpl();
		}
		return orderDao;
	}
	private static CategoryDao categoryDao;
	private static OrderDao orderDao;
	private static ProductDao productDao;
	private static UserDao userDao;
}
